UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4g+XAww01YzGzirVjPRwCgpwe8XmFNM8srPRDgvkdXg='
WHERE
key_id = '28b76f113ecf2c0392ff467aa9bcb840ae1b5c5700e30281e7fb1f997af94157'
AND (
token = '4g+XAww01YzGzirVjPRwCgpwe8XmFNM8srPRDgvkdXg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)