UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1KUmoOv+zl2AKgP0Zho/XQ6BugTm6PFmh+8BOryZjZs='
WHERE
key_id = '8f39d8bf582b986137848484019a361910f8b13e7b7ce95719f3a37382a8c4e6'
AND (
token = '1KUmoOv+zl2AKgP0Zho/XQ6BugTm6PFmh+8BOryZjZs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)