UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mj/wH9BbB3TUsWXxyXMtbyjnVuto0MbWTtChZDXY+DY='
WHERE
key_id = '1bdfc3a5c07c7d6a7c6333e3eef6f8c7b1c7dbec849a9fcd7b79b4d492056794'
AND (
token = 'mj/wH9BbB3TUsWXxyXMtbyjnVuto0MbWTtChZDXY+DY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)