UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vQuNbsRKakJ40GSSA4U4ZipiSvmRv7DZ9fpFUzVAovw='
WHERE
key_id = '0c29c4956404b4d436934d0304d7f29633621bc176ff1a47af8db290c8f21daf'
AND (
token = 'vQuNbsRKakJ40GSSA4U4ZipiSvmRv7DZ9fpFUzVAovw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)