UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R0ofxQ0W1iiyDQQBe3E3Bz97ziHem8mhzWzskR8b26k='
WHERE
key_id = '431ed70e37d8f9578e218cc1c42278850ffa6bf9929ad601416368f2233ad590'
AND (
token = 'R0ofxQ0W1iiyDQQBe3E3Bz97ziHem8mhzWzskR8b26k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)