UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zcHqHO2lPyBKdnY3W3KJmixf7MKzwLmqN756kP3srsA='
WHERE
key_id = '3091754da41576aece10f580522bddb5a9789716fac9f16fb98dd2fb712b1b74'
AND (
token = 'zcHqHO2lPyBKdnY3W3KJmixf7MKzwLmqN756kP3srsA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)