UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CdW9mubyP0RPp80qdmy76AvIsekY6CwqeXMR+RV79z0='
WHERE
key_id = '7fe2f4d2eb13a1cd40283ac14594df69d261f938979ec4e2f2fd506fd751e4b0'
AND (
token = 'CdW9mubyP0RPp80qdmy76AvIsekY6CwqeXMR+RV79z0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)