UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vGrkq8HnyjSdnUN3PU9WZC0zZTQCyU/5qvOgbbbEiXs='
WHERE
key_id = 'ae04a3d9b1cbf40540d85485a75bc891f22ce1f1042bdfab586b89820b93512e'
AND (
token = 'vGrkq8HnyjSdnUN3PU9WZC0zZTQCyU/5qvOgbbbEiXs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)