UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/wB4Rr2NX04Dlruwp5hCimoCn40h17HC+sJzbGTL8OY='
WHERE
key_id = '497afc9c707749ce75855aabffca81be9a954430504e46f236fddecef916c753'
AND (
token = '/wB4Rr2NX04Dlruwp5hCimoCn40h17HC+sJzbGTL8OY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)