UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tUo/Pj/JRx40LVzH1IG1TQmWzWvwrBpvV9I4QCJo0Yg='
WHERE
key_id = '93c20f3053b013d640657ec499a47cfb10c8b86e8f47c3dbd8b40d307eac3acf'
AND (
token = 'tUo/Pj/JRx40LVzH1IG1TQmWzWvwrBpvV9I4QCJo0Yg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)