UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+51Jymjk5FCzbOh/t3ZffdVgwZhCGy3zzwTJkFnfsh8=' 
WHERE 
  key_id = '1ea5d324bc0e43e677cf6e528fe620c158312f18b091f78a34250fe97c64bc46' 
  AND (
    token = '+51Jymjk5FCzbOh/t3ZffdVgwZhCGy3zzwTJkFnfsh8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044