UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U3DUtYqj/Vm62w3UGLW7MxpAxmElUGNyf67fpg3xcms='
WHERE
key_id = '638aa1e540c53a5e54b677007b090948ca86f3b9653230538c0acfe943eba5ff'
AND (
token = 'U3DUtYqj/Vm62w3UGLW7MxpAxmElUGNyf67fpg3xcms='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)