UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xwawtYCO/t2F+BDALN+yY4+ND/HBEVqvKHJ+N9D3Cug='
WHERE
key_id = 'ee1ddeb7d6bf59dae44f48e816a428c172a0a70a42517a830cab340d8c2761eb'
AND (
token = 'xwawtYCO/t2F+BDALN+yY4+ND/HBEVqvKHJ+N9D3Cug='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)