UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G+zy08dj3I9raGCv9mjHv+1U4t7TAbfqH6zZKOpRkD4='
WHERE
key_id = '6988215b5df6c5284986cb3d40e097d9c2feaec680dcb956cfe326bc3035f185'
AND (
token = 'G+zy08dj3I9raGCv9mjHv+1U4t7TAbfqH6zZKOpRkD4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)