UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PgxZ2GTUptDg/yIz+6cS62nRZCL+PsCFh45k8sufR38='
WHERE
key_id = '6de1e4e3550106da622402b6c18157edea60207b769ea2d0adf813689ffa65ea'
AND (
token = 'PgxZ2GTUptDg/yIz+6cS62nRZCL+PsCFh45k8sufR38='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)