UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RpgiKS9XMGKihS1pglEyVqW7rXrxoJVp9PE/wk+nfkg='
WHERE
key_id = '711c9e8de42caad8afd613117f6213cd43695ceb7c9745f564afd494f55be3fa'
AND (
token = 'RpgiKS9XMGKihS1pglEyVqW7rXrxoJVp9PE/wk+nfkg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)