UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y4oI5TEB3NOIhflYK8jIWqacLZiU0xvqmrUavCydm88='
WHERE
key_id = '30e6f700cce92076278e168cc9457148e2e1cb64de290380ed4ce4b39a75b824'
AND (
token = 'y4oI5TEB3NOIhflYK8jIWqacLZiU0xvqmrUavCydm88='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)