UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ha/+cZ8s3SUzzFCNYNiCm/ox/4bZyYcRj5GqxDRdRH8='
WHERE
key_id = 'da16b2b5298fced3c93990074afe69f54b0bfb07dc1d9edbc23ed8055460d47e'
AND (
token = 'Ha/+cZ8s3SUzzFCNYNiCm/ox/4bZyYcRj5GqxDRdRH8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)