UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2oBKg7Ik6mZx4XU7loL0Em4cLyiR8/1GRnS/GHb2JgM='
WHERE
key_id = '4eeca36f26da5592a2cfbbc372128c205efcf127ff47e307f022ed9bc16bb916'
AND (
token = '2oBKg7Ik6mZx4XU7loL0Em4cLyiR8/1GRnS/GHb2JgM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)