UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tUCYQfDUS8QSwshDajh02fI3r8JNo/b8gDrB59h6eoA='
WHERE
key_id = '39036afefed644c602c0bd933014801e9756269d8cc8c9564b4226c3f810f9e6'
AND (
token = 'tUCYQfDUS8QSwshDajh02fI3r8JNo/b8gDrB59h6eoA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)