UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '42dZiSqV4vGuofnZSMBH8+6V6IThy90MliPuNLQn2hU='
WHERE
key_id = '98a3f824a17505eaf78048c91bb363190dfa9541616e2667513e45a370a4ab5d'
AND (
token = '42dZiSqV4vGuofnZSMBH8+6V6IThy90MliPuNLQn2hU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)