UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's2k1IsoMr0vCjG7M/HUEqT9ePKuwLkuSIU3Ikd4QNAU='
WHERE
key_id = 'bc5d2fd34dc8cf23a105424ed6c25ff3d718fd981c9eeaaf1c0c8096c7d541ee'
AND (
token = 's2k1IsoMr0vCjG7M/HUEqT9ePKuwLkuSIU3Ikd4QNAU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)