UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pBNGLqZpJI6WnCoVNUB9ic2TLDbWfj/VLK8e48RnpOo='
WHERE
key_id = 'fce594017b6f633f93cb51d7ccbcc737f424ebfbdca6cc24c374c7d685ebe188'
AND (
token = 'pBNGLqZpJI6WnCoVNUB9ic2TLDbWfj/VLK8e48RnpOo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)