UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XKoXDOnaDtcCQia/0nqW+T8RsjgG06Qy4cnvc2dKFJg='
WHERE
key_id = '0c72b9a38a93c52e827b8c149ed6a3beafa449d2e0db929743eb2555ae6f6d73'
AND (
token = 'XKoXDOnaDtcCQia/0nqW+T8RsjgG06Qy4cnvc2dKFJg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)