UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wQ5qE16NaybQJ0TUJBLxluPBEbvrcBpkw/X2WHXN5wU='
WHERE
key_id = '6ea11e3e4161d921a6a72ee9d1688e2dc58e1afc101530ad58eac26aea649dab'
AND (
token = 'wQ5qE16NaybQJ0TUJBLxluPBEbvrcBpkw/X2WHXN5wU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)