UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SwXKRraEt6RyCu70Tu2caRDR3KyZQvjSaIo3gkwDmzo='
WHERE
key_id = '238e4e711effca5429b27c4e4adf3ed9aa6f47d0215cecdb0d60af978b405bde'
AND (
token = 'SwXKRraEt6RyCu70Tu2caRDR3KyZQvjSaIo3gkwDmzo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)