UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rmEORfDuq5OkionOGZW59l5qKJ4YPRBR2O43IUZcDgc='
WHERE
key_id = 'c0f8d0fe6001a8c6002dd1926dbb5d9efdb74532c4a25d3ba4eb59a044d6d409'
AND (
token = 'rmEORfDuq5OkionOGZW59l5qKJ4YPRBR2O43IUZcDgc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)