UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M8kLTu4M/J3MLSxVPn/dYQU38XqCO2E7o/sWKmn5zJY='
WHERE
key_id = '0cfb8ef3ae93e0faabb5e22fa7ec4240248363fc1857e31cade7b113d953eb2d'
AND (
token = 'M8kLTu4M/J3MLSxVPn/dYQU38XqCO2E7o/sWKmn5zJY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)