UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l8ZmgoQG1eiPOWOho1ivQ3/uRXxbbz4XQW7b4MvMULI='
WHERE
key_id = 'b4873fccb101828ce860ae4e7932bbfd4feb940c676f6be79c57d4f00f98a7bf'
AND (
token = 'l8ZmgoQG1eiPOWOho1ivQ3/uRXxbbz4XQW7b4MvMULI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)