UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's2rvgICmBEBv8Y2Nn/h0V3ITJJcAWX0EV/btw+inuDs='
WHERE
key_id = '22d75d2c0c8401bd6fded2f4de1491a9f825dbde28bac99c98fd0b7ce83e5680'
AND (
token = 's2rvgICmBEBv8Y2Nn/h0V3ITJJcAWX0EV/btw+inuDs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)