UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D7q0rveSQb5XaBm7y6j5ch1w4GAZMfOC9ksVC+JVEew=' 
WHERE 
  key_id = '72437b06fa32a618ec2cda737a03b5c0b9ea09960df536e0a78a056846be4434' 
  AND (
    token = 'D7q0rveSQb5XaBm7y6j5ch1w4GAZMfOC9ksVC+JVEew=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033