UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o3o5KXGgmtWSMJYoWlXd9Isq1Ni5fe5/EG4zMg4Zxqw='
WHERE
key_id = 'cfa5a2320de3e50a7a1be4c8b9ca860af21ef2b3bdf46b3ba0043829c9744554'
AND (
token = 'o3o5KXGgmtWSMJYoWlXd9Isq1Ni5fe5/EG4zMg4Zxqw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)