UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UrojS/5mPeBXaRqxd9RZI55oJ9PbRY1APPlOFMv8XgU='
WHERE
key_id = 'd1eeca606881a7fb979d38be409ae18751982d8144f02b94c9f57e3f08badd91'
AND (
token = 'UrojS/5mPeBXaRqxd9RZI55oJ9PbRY1APPlOFMv8XgU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)